home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / os2 / ue311gcc.zip / EDEF.H < prev    next >
Text File  |  1992-12-31  |  18KB  |  370 lines

  1. /*    EDEF:        Global variable definitions for
  2.             MicroEMACS 3.9
  3.  
  4.                         written by Daniel Lawrence
  5.                         based on code by Dave G. Conroy,
  6.                             Steve Wilhite and George Jones
  7. */
  8.  
  9. #ifdef    maindef
  10.  
  11. /* for MAIN.C */
  12.  
  13. /* initialized global definitions */
  14.  
  15. NOSHARE int DNEAR fillcol = 72;     /* Current fill column        */
  16. NOSHARE short kbdm[NKBDM];        /* Macro            */
  17. NOSHARE char *execstr = NULL;        /* pointer to string to execute */
  18. NOSHARE char golabel[NPAT] = "";    /* current line to go to    */
  19. NOSHARE char paralead[NPAT] = " \t";    /* paragraph leadin chars    */
  20. NOSHARE char fmtlead[NPAT] = "";    /* format command leadin chars    */
  21. NOSHARE char mainbuf[] = "main";    /* name of main buffer        */
  22. NOSHARE char lterm[NSTRING];        /* line terminators on file write */
  23. NOSHARE unsigned char wordlist[256];    /* characters considered "in words" */
  24. NOSHARE int DNEAR wlflag = FALSE;    /* word list enabled flag    */
  25. NOSHARE int DNEAR clearflag = TRUE;    /* clear screen on screen change? */
  26. NOSHARE int DNEAR execlevel = 0;    /* execution IF level        */
  27. NOSHARE int DNEAR eolexist = TRUE;    /* does clear to EOL exist?    */
  28. NOSHARE int DNEAR revexist = FALSE;    /* does reverse video exist?    */
  29. NOSHARE int DNEAR exec_error = FALSE;    /* macro execution error pending? */
  30. NOSHARE int DNEAR flickcode = TRUE;    /* do flicker supression?    */
  31. CONST char *modename[] = {         /* name of modes        */
  32.     "WRAP", "CMODE", "SPELL", "EXACT", "VIEW", "OVER",
  33.     "MAGIC", "CRYPT", "ASAVE", "REP"};
  34. CONST char modecode[] = "WCSEVOMYAR";    /* letters to represent modes    */
  35. NOSHARE int DNEAR numfunc = NFUNCS;    /* number of bindable functions */
  36. NOSHARE int DNEAR gmode = 0;        /* global editor mode        */
  37. NOSHARE int DNEAR gflags = GFREAD;    /* global control flag        */
  38. NOSHARE int DNEAR gfcolor = 7;        /* global forgrnd color (white) */
  39. NOSHARE int DNEAR gbcolor = 0;        /* global backgrnd color (black)*/
  40. NOSHARE int DNEAR deskcolor = 0;    /* desktop background color    */
  41. NOSHARE int DNEAR gasave = 256;     /* global ASAVE size        */
  42. NOSHARE int DNEAR gacount = 256;    /* count until next ASAVE    */
  43. NOSHARE int DNEAR sgarbf = TRUE;     /* TRUE if screen is garbage    */
  44. NOSHARE int DNEAR mpresf = FALSE;    /* TRUE if message in last line */
  45. NOSHARE int DNEAR clexec = FALSE;    /* command line execution flag    */
  46. NOSHARE int DNEAR mstore = FALSE;    /* storing text to macro flag    */
  47. NOSHARE int DNEAR discmd = TRUE;     /* display command flag     */
  48. NOSHARE int DNEAR disinp = TRUE;     /* display input characters    */
  49. NOSHARE int DNEAR modeflag = TRUE;    /* display modelines flag    */
  50. NOSHARE int DNEAR popflag = TRUE;    /* pop-up windows enabled?    */
  51. NOSHARE int cpending = FALSE;        /* input character pending?    */
  52. NOSHARE int charpending;        /* character pushed back    */
  53. NOSHARE int DNEAR sscroll = FALSE;    /* smooth scrolling enabled flag*/
  54. NOSHARE int DNEAR hscroll = TRUE;    /* horizontal scrolling flag    */
  55. NOSHARE int DNEAR hjump = 1;        /* horizontal jump size     */
  56. NOSHARE int DNEAR ssave = TRUE;     /* safe save flag        */
  57. NOSHARE struct BUFFER *bstore = NULL;    /* buffer to store macro text to*/
  58. NOSHARE int DNEAR vtrow = 0;        /* Row location of SW cursor    */
  59. NOSHARE int DNEAR vtcol = 0;        /* Column location of SW cursor */
  60. NOSHARE int DNEAR ttrow = HUGE;     /* Row location of HW cursor    */
  61. NOSHARE int DNEAR ttcol = HUGE;     /* Column location of HW cursor */
  62. NOSHARE int DNEAR lbound = 0;        /* leftmost column of current line
  63.                        being displayed        */
  64. NOSHARE int DNEAR taboff = 0;        /* tab offset for display    */
  65. NOSHARE int DNEAR tabsize = 8;        /* current hard tab size    */
  66. NOSHARE int DNEAR stabsize = 0;        /* current soft tab size (0: use hard tabs)  */
  67. NOSHARE int DNEAR reptc = CTRL | 'U';    /* current universal repeat char*/
  68. NOSHARE int DNEAR abortc = CTRL | 'G';    /* current abort command char    */
  69. NOSHARE int DNEAR sterm = CTRL | '[';    /* search terminating character */
  70. NOSHARE int DNEAR searchtype = SRNORM;    /* current search style        */
  71. NOSHARE int DNEAR yankflag = FALSE;    /* current yank style        */
  72.  
  73. NOSHARE int DNEAR prefix = 0;        /* currently pending prefix bits */
  74. NOSHARE int DNEAR prenum = 0;        /*     "       "     numeric arg */
  75. NOSHARE int DNEAR predef = TRUE;    /*     "       "     default flag */
  76.  
  77. NOSHARE int DNEAR quotec = CTRL | 'Q';    /* quote char during mlreply() */
  78. NOSHARE CONST char *cname[] = {        /* names of colors        */
  79.     "BLACK", "RED", "GREEN", "YELLOW", "BLUE",
  80.     "MAGENTA", "CYAN", "GREY",
  81.     "GRAY", "LRED", "LGREEN", "LYELLOW", "LBLUE",
  82.     "LMAGENTA", "LCYAN", "WHITE"};
  83.   
  84. NOSHARE KILL *kbufp = NULL;        /* current kill buffer chunk pointer*/
  85. NOSHARE KILL *kbufh = NULL;        /* kill buffer header pointer    */
  86. NOSHARE    int kskip = 0;            /* # of bytes to skip in 1st kill chunk */
  87. NOSHARE int kused = KBLOCK;        /* # of bytes used in last kill chunk*/
  88. NOSHARE WINDOW *swindow = NULL;     /* saved window pointer     */
  89. NOSHARE int cryptflag = FALSE;        /* currently encrypting?    */
  90. NOSHARE int oldcrypt = FALSE;        /* using old(broken) encryption? */
  91. NOSHARE short *kbdptr;            /* current position in keyboard buf */
  92. NOSHARE short *kbdend = &kbdm[0];    /* ptr to end of the keyboard */
  93. NOSHARE int DNEAR kbdmode = STOP;    /* current keyboard macro mode    */
  94. NOSHARE int DNEAR kbdrep = 0;        /* number of repetitions    */
  95. NOSHARE int DNEAR restflag = FALSE;    /* restricted use?        */
  96. NOSHARE int DNEAR lastkey = 0;        /* last keystoke        */
  97. NOSHARE int DNEAR seed = 0;        /* random number seed        */
  98. NOSHARE long envram = 0l;        /* # of bytes current in use by malloc */
  99. NOSHARE int DNEAR macbug = FALSE;    /* macro debugging flag        */
  100. NOSHARE int DNEAR mouseflag = TRUE;    /* use the mouse?        */
  101. NOSHARE int DNEAR diagflag = FALSE;    /* diagonal mouse movements?    */
  102. CONST char errorm[] = "ERROR";        /* error literal        */
  103. CONST char truem[] = "TRUE";        /* true literal         */
  104. CONST char falsem[] = "FALSE";        /* false litereal        */
  105. NOSHARE int DNEAR cmdstatus = TRUE;    /* last command status        */
  106. NOSHARE char palstr[49] = "";        /* palette string        */
  107. NOSHARE char lastmesg[NSTRING] = "";     /* last message posted        */
  108. NOSHARE char *lastptr = NULL;        /* ptr to lastmesg[]        */
  109. NOSHARE int DNEAR saveflag = 0;     /* Flags, saved with the $target var */
  110. NOSHARE char *fline = NULL;        /* dynamic return line        */
  111. NOSHARE int DNEAR flen = 0;        /* current length of fline    */
  112. NOSHARE int DNEAR rval = 0;        /* return value of a subprocess */
  113. NOSHARE int DNEAR eexitflag = FALSE;    /* EMACS exit flag        */
  114. NOSHARE int DNEAR eexitval = 0;     /* and the exit return value    */
  115. NOSHARE int xpos = 0;        /* current column mouse is positioned to*/
  116. NOSHARE int ypos = 0;        /* current screen row         "        */
  117. NOSHARE int nclicks = 0;    /* cleared on any non-mouse event    */
  118. NOSHARE int disphigh = FALSE;    /* display high bit chars escaped    */
  119.  
  120. /* uninitialized global definitions */
  121.  
  122. NOSHARE int DNEAR currow;    /* Cursor row            */
  123. NOSHARE int DNEAR curcol;    /* Cursor column        */
  124. NOSHARE int DNEAR thisflag;    /* Flags, this command        */
  125. NOSHARE int DNEAR lastflag;    /* Flags, last command        */
  126. NOSHARE int DNEAR curgoal;    /* Goal for C-P, C-N        */
  127. NOSHARE WINDOW *curwp;         /* Current window        */
  128. NOSHARE BUFFER *curbp;         /* Current buffer        */
  129. NOSHARE WINDOW *wheadp;        /* Head of list of windows    */
  130. NOSHARE BUFFER *bheadp;        /* Head of list of buffers     */
  131. NOSHARE SCREEN *first_screen;    /* Head and current screen in list */
  132. NOSHARE BUFFER *blistp;        /* Buffer for C-X C-B        */
  133. NOSHARE BUFFER *slistp;        /* Buffer for A-B        */
  134.  
  135. NOSHARE char sres[NBUFN];    /* current screen resolution    */
  136.  
  137. NOSHARE    char lowcase[HICHAR];    /* lower casing map        */
  138. NOSHARE    char upcase[HICHAR];    /* upper casing map        */
  139.  
  140. NOSHARE char pat[NPAT];        /* Search pattern        */
  141. NOSHARE char tap[NPAT];        /* Reversed pattern array.    */
  142. NOSHARE char rpat[NPAT];    /* replacement pattern        */
  143.  
  144. /*    Various "Hook" execution variables    */
  145.  
  146. NOSHARE KEYTAB readhook;    /* executed on all file reads */
  147. NOSHARE KEYTAB wraphook;    /* executed when wrapping text */
  148. NOSHARE KEYTAB cmdhook;        /* executed before looking for a command */
  149. NOSHARE KEYTAB writehook;    /* executed on all file writes */
  150. NOSHARE KEYTAB exbhook;        /* executed when exiting a buffer */
  151. NOSHARE KEYTAB bufhook;        /* executed when entering a buffer */
  152.  
  153. /*    The variable patmatch holds the
  154.     string that satisfies the search command.
  155. */
  156. NOSHARE char *patmatch = NULL;
  157.  
  158. #if    MAGIC
  159. /*
  160.  * The variables magical and rmagical determine if there
  161.  * were actual metacharacters in the search and replace strings -
  162.  * if not, then we don't have to use the slower MAGIC mode
  163.  * search functions.
  164.  */
  165. NOSHARE short int DNEAR magical = FALSE;
  166. NOSHARE short int DNEAR rmagical = FALSE;
  167. NOSHARE MC mcpat[NPAT];     /* the magic pattern        */
  168. NOSHARE MC tapcm[NPAT];     /* the reversed magic pattern    */
  169. NOSHARE RMC rmcpat[NPAT];    /* the replacement magic array    */
  170. NOSHARE char *grpmatch[MAXGROUPS];    /* holds groups found in search */ 
  171.  
  172. #endif
  173.  
  174. /* directive name table:
  175.     This holds the names of all the directives....    */
  176.  
  177. CONST char *dname[] = {
  178.     "if", "else", "endif",
  179.     "goto", "return", "endm",
  180.     "while", "endwhile", "break",
  181.     "force"
  182. };
  183.  
  184. #if    DEBUGM
  185. /*    vars needed for macro debugging output    */
  186. NOSHARE char outline[NSTRING];    /* global string to hold debug line text */
  187. #endif
  188.  
  189. /*
  190.  * System message notification (at the moment, VMS only).
  191.  */
  192. #if    VMS
  193. NOSHARE char brdcstbuf[1024];        /* Broadcast messages */
  194. NOSHARE int pending_msg = FALSE;    /* Flag - have we notified user yet.*/
  195. #endif
  196.  
  197. #else
  198.  
  199. /* for all the other .C files */
  200.  
  201. /* initialized global external declarations */
  202.  
  203. NOSHARE extern int DNEAR fillcol;    /* Current fill column        */
  204. NOSHARE extern short kbdm[];        /* Holds kayboard macro data    */
  205. NOSHARE extern char *execstr;        /* pointer to string to execute */
  206. NOSHARE extern char golabel[];        /* current line to go to    */
  207. NOSHARE extern char paralead[];        /* paragraph leadin chars    */
  208. NOSHARE extern char fmtlead[];        /* format command leadin chars    */
  209. NOSHARE extern char mainbuf[];        /* name of main buffer        */
  210. NOSHARE extern char lterm[];        /* line terminators on file write */
  211. NOSHARE extern unsigned char wordlist[];/* characters considered "in words" */
  212. NOSHARE extern int DNEAR wlflag;    /* word list enabled flag    */
  213. NOSHARE extern int DNEAR clearflag;    /* clear screen on screen change? */
  214. NOSHARE extern int DNEAR execlevel;    /* execution IF level        */
  215. NOSHARE extern int DNEAR eolexist;    /* does clear to EOL exist?    */
  216. NOSHARE extern int DNEAR revexist;    /* does reverse video exist?    */
  217. NOSHARE extern int DNEAR exec_error;    /* macro execution error pending? */
  218. NOSHARE extern int DNEAR flickcode;    /* do flicker supression?    */
  219. CONST extern char *modename[];        /* text names of modes        */
  220. CONST extern char modecode[];        /* letters to represent modes    */
  221. NOSHARE extern int DNEAR numfunc;    /* number of bindable functions */
  222. NOSHARE extern KEYTAB keytab[];        /* key bind to functions table    */
  223. NOSHARE extern NBIND names[];        /* name to function table    */
  224. NOSHARE extern int DNEAR gmode;        /* global editor mode        */
  225. NOSHARE extern int DNEAR gflags;    /* global control flag        */
  226. NOSHARE extern int DNEAR gfcolor;    /* global forgrnd color (white) */
  227. NOSHARE extern int DNEAR gbcolor;    /* global backgrnd color (black)*/
  228. NOSHARE extern int DNEAR deskcolor;    /* desktop background color    */
  229. NOSHARE extern int DNEAR gasave;    /* global ASAVE size        */
  230. NOSHARE extern int DNEAR gacount;    /* count until next ASAVE    */
  231. NOSHARE extern int DNEAR sgarbf;    /* State of screen unknown    */
  232. NOSHARE extern int DNEAR mpresf;    /* Stuff in message line    */
  233. NOSHARE extern int DNEAR clexec;    /* command line execution flag    */
  234. NOSHARE extern int DNEAR mstore;    /* storing text to macro flag    */
  235. NOSHARE extern int DNEAR discmd;    /* display command flag     */
  236. NOSHARE extern int DNEAR disinp;    /* display input characters    */
  237. NOSHARE extern int DNEAR modeflag;    /* display modelines flag    */
  238. NOSHARE extern int DNEAR popflag;    /* pop-up windows enabled?    */
  239. NOSHARE extern int cpending;        /* input character pending?    */
  240. NOSHARE extern int charpending;        /* character pushed back    */
  241. NOSHARE extern int DNEAR sscroll;    /* smooth scrolling enabled flag*/
  242. NOSHARE extern int DNEAR hscroll;    /* horizontal scrolling flag    */
  243. NOSHARE extern int DNEAR hjump;        /* horizontal jump size     */
  244. NOSHARE extern int DNEAR ssave;        /* safe save flag        */
  245. NOSHARE extern struct BUFFER *bstore;    /* buffer to store macro text to*/
  246. NOSHARE extern int DNEAR vtrow;        /* Row location of SW cursor    */
  247. NOSHARE extern int DNEAR vtcol;        /* Column location of SW cursor */
  248. NOSHARE extern int DNEAR ttrow;        /* Row location of HW cursor    */
  249. NOSHARE extern int DNEAR ttcol;        /* Column location of HW cursor */
  250. NOSHARE extern int DNEAR lbound;    /* leftmost column of current line
  251.                        being displayed        */
  252. NOSHARE extern int DNEAR taboff;    /* tab offset for display    */
  253. NOSHARE extern int DNEAR tabsize;    /* current hard tab size    */
  254. NOSHARE extern int DNEAR stabsize;    /* current soft tab size (0: use hard tabs)  */
  255. NOSHARE extern int DNEAR reptc;        /* current universal repeat char*/
  256. NOSHARE extern int DNEAR abortc;    /* current abort command char    */
  257. NOSHARE extern int DNEAR sterm;        /* search terminating character */
  258. NOSHARE extern int DNEAR searchtype;    /* current search style        */
  259. NOSHARE extern int DNEAR yankflag;    /* current yank style        */
  260.  
  261. NOSHARE extern int DNEAR prefix;    /* currently pending prefix bits */
  262. NOSHARE extern int DNEAR prenum;    /*     "       "     numeric arg */
  263. NOSHARE extern int DNEAR predef;    /*     "       "     default flag */
  264.  
  265. NOSHARE extern int DNEAR quotec;    /* quote char during mlreply() */
  266. NOSHARE extern CONST char *cname[];    /* names of colors        */
  267.   
  268. NOSHARE extern KILL *kbufp;        /* current kill buffer chunk pointer */
  269. NOSHARE extern KILL *kbufh;        /* kill buffer header pointer    */
  270. NOSHARE    extern int kskip;        /* # of bytes to skip in 1st kill chunk */
  271. NOSHARE extern int kused;        /* # of bytes used in kill buffer*/
  272. NOSHARE extern WINDOW *swindow;     /* saved window pointer     */
  273. NOSHARE extern int cryptflag;        /* currently encrypting?    */
  274. NOSHARE extern int oldcrypt;        /* using old(broken) encryption? */
  275. NOSHARE extern short *kbdptr;        /* current position in keyboard buf */
  276. NOSHARE extern short *kbdend;        /* ptr to end of the keyboard */
  277. NOSHARE extern int kbdmode;        /* current keyboard macro mode    */
  278. NOSHARE extern int kbdrep;        /* number of repetitions    */
  279. NOSHARE extern int restflag;        /* restricted use?        */
  280. NOSHARE extern int lastkey;        /* last keystoke        */
  281. NOSHARE extern int seed;        /* random number seed        */
  282. NOSHARE extern long envram;        /* # of bytes current in use by malloc */
  283. NOSHARE extern int DNEAR macbug;    /* macro debugging flag        */
  284. NOSHARE extern int DNEAR mouseflag;    /* use the mouse?        */
  285. NOSHARE extern int DNEAR diagflag;    /* diagonal mouse movements?    */
  286. CONST extern char errorm[];        /* error literal        */
  287. CONST extern char truem[];        /* true literal         */
  288. CONST extern char falsem[];        /* false litereal        */
  289. NOSHARE extern int DNEAR cmdstatus;    /* last command status        */
  290. NOSHARE extern char palstr[];        /* palette string        */
  291. NOSHARE extern char lastmesg[];        /* last message posted        */
  292. NOSHARE extern char *lastptr;        /* ptr to lastmesg[]        */
  293. NOSHARE extern int DNEAR saveflag;    /* Flags, saved with the $target var */
  294. NOSHARE extern char *fline;         /* dynamic return line */
  295. NOSHARE extern int DNEAR flen;         /* current length of fline */
  296. NOSHARE extern int DNEAR rval;         /* return value of a subprocess */
  297. NOSHARE extern int DNEAR eexitflag;    /* EMACS exit flag */
  298. NOSHARE extern int DNEAR eexitval;    /* and the exit return value */
  299. NOSHARE extern int xpos;        /* current column mouse is positioned to */
  300. NOSHARE extern int ypos;        /* current screen row         "     */
  301. NOSHARE extern int nclicks;        /* cleared on any non-mouse event*/
  302. NOSHARE extern int disphigh;        /* display high bit chars escaped*/
  303.  
  304. /* uninitialized global external declarations */
  305.  
  306. NOSHARE extern int DNEAR currow;    /* Cursor row            */
  307. NOSHARE extern int DNEAR curcol;    /* Cursor column        */
  308. NOSHARE extern int DNEAR thisflag;    /* Flags, this command        */
  309. NOSHARE extern int DNEAR lastflag;    /* Flags, last command        */
  310. NOSHARE extern int DNEAR curgoal;    /* Goal for C-P, C-N        */
  311. NOSHARE extern WINDOW *curwp;         /* Current window        */
  312. NOSHARE extern BUFFER *curbp;         /* Current buffer        */
  313. NOSHARE extern WINDOW *wheadp;        /* Head of list of windows    */
  314. NOSHARE extern BUFFER *bheadp;        /* Head of list of buffers    */
  315. NOSHARE extern SCREEN *first_screen;    /* Head and current screen in list */
  316. NOSHARE extern BUFFER *blistp;        /* Buffer for C-X C-B        */
  317. NOSHARE extern BUFFER *slistp;        /* Buffer for A-B        */
  318.  
  319. NOSHARE extern char sres[NBUFN];    /* current screen resolution    */
  320.  
  321. NOSHARE    extern char lowcase[HICHAR];    /* lower casing map        */
  322. NOSHARE    extern char upcase[HICHAR];    /* upper casing map        */
  323.  
  324. NOSHARE extern char pat[];        /* Search pattern        */
  325. NOSHARE extern char tap[];        /* Reversed pattern array.    */
  326. NOSHARE extern char rpat[];         /* replacement pattern        */
  327.  
  328. /*    Various "Hook" execution variables    */
  329.  
  330. NOSHARE extern KEYTAB readhook;        /* executed on all file reads */
  331. NOSHARE extern KEYTAB wraphook;        /* executed when wrapping text */
  332. NOSHARE extern KEYTAB cmdhook;        /* executed before looking for a cmd */
  333. NOSHARE extern KEYTAB writehook;    /* executed on all file writes */
  334. NOSHARE extern KEYTAB exbhook;        /* executed when exiting a buffer */
  335. NOSHARE extern KEYTAB bufhook;        /* executed when entering a buffer */
  336.  
  337. NOSHARE extern char *patmatch;
  338.  
  339. #if    MAGIC
  340. NOSHARE extern short int magical;
  341. NOSHARE extern short int rmagical;
  342. NOSHARE extern MC mcpat[NPAT];        /* the magic pattern        */
  343. NOSHARE extern MC tapcm[NPAT];        /* the reversed magic pattern    */
  344. NOSHARE extern RMC rmcpat[NPAT];    /* the replacement magic array    */
  345. NOSHARE extern char *grpmatch[MAXGROUPS];    /* holds groups found in search */ 
  346. #endif
  347.  
  348. CONST extern char *dname[];        /* directive name table     */
  349.  
  350. #if    DEBUGM
  351. /*    vars needed for macro debugging output    */
  352. NOSHARE extern char outline[];    /* global string to hold debug line text */
  353. #endif
  354.  
  355. /*
  356.  * System message notification (at the moment, VMS only).
  357.  */
  358. #if    VMS
  359. NOSHARE extern char brdcstbuf[1024];        /* Broadcast messages */
  360. NOSHARE extern int pending_msg;        /* Flag - have we notified user yet.*/
  361. #endif
  362.  
  363. #endif
  364.  
  365. /* terminal table defined only in TERM.C */
  366.  
  367. #ifndef termdef
  368. NOSHARE extern TERM    term;        /* Terminal information.    */
  369. #endif
  370.